package br.edu.ufcg.lsd.wbis.control.equipment;

import java.sql.Date;

import javax.persistence.Embeddable;
import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

/**
 * 
 * @author Paulo Ricardo
 *
 */
@Entity
@Embeddable
@Inheritance(strategy=InheritanceType.JOINED)
public class Component extends Equipment {

	@ManyToOne
    @JoinColumn(name="computerId", insertable=false, updatable=false, nullable=true)
	private Computer computer;

	protected Component(){}
	
	/**
	 * 
	 * @param inventoryCode
	 * @param brand
	 * @param serialCode
	 * @param acquisitionDate
	 * @param model
	 * @param localization
	 * @param receipt
	 * @param alocable
	 * @param available
	 * @param coupled
	 */
	public Component(String inventoryCode, String brand, String serialCode,
			Date acquisitionDate, String model, String localization,
			byte[] receipt, Computer computer, boolean alocable, boolean available, Class<? extends Component> clazz) {
		super(inventoryCode, brand, serialCode, acquisitionDate, model, localization,
				receipt, alocable, available, clazz);
		this.computer = computer;
	}

	protected Computer getComputer() {
		return computer;
	}

	protected void setComputer(Computer computer) {
		this.computer = computer;
	}
}
